<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<hdjs/>
	<js file='__CONTROLLER_VIEW__/Js/goods.js'/>
	<style type="text/css">
		li{
			height: 35px;
			font-size: 20px;
		}
		li.spec span{			
			padding: 5px;
			border: 2px solid #eee;
			cursor: pointer;
		}
		li.spec span.active{
			background-color: green;
			color: #fff;
		}

	</style>
</head>
<body>
	<h1>{$field.goods_name}</h1>
	<h4>商场价:{$field.goods_price}</h4>
	<hr/>
	<h3>规格</h3>
	<ul>
		<list from='$goodsAttr' name='$ga'>
			<if value="$ga.attr_type eq 2">
				<li class="spec">
					<strong>{$ga.attr_name}</strong>
					<list from='$ga.attr' name='$ga1'>
						<span id="{$ga1.id}">{$ga1.attr_value}</span>
					</list>
				</li>	
			</if>
		</list>
	</ul>
	<hr/>
	<h3>商品列表</h3>
	<form action="{|U:'Cart/add'}" method="post" onsubmit="return addCart(this);">
		购买数量:<input type="text" name="num" class="w100 h30">
		<input type="hidden" name="gid" value="{$field.gid}" class="w100 h30">
		<input type="hidden" name="product_id" id="productId" class="w100 h30">
		<span id="message" style="color:red" ></span>
		<input type="submit" value="加入购物车" class="hd-success" >
	</form>
	<div>
		<h3>规格参数</h3>
		<ul>
			<list from='$goodsAttr' name='$ga'>
				<li>
					<strong>{$ga.attr_name}</strong>
					<list from='$ga.attr' name='$ga1'>
						<span>{$ga1.attr_value}</span>
					</list>
				</li>
			</list>
		</ul>
	</div>

</body>
</html>